package com.xhj.joffer.aa;
import org.junit.Test;
/**
 * @author haijianxia pure_xhj@163.com
 * @Date 2021-09-22
 * @Time 17:25
 */
public class SumNotAdd {
  public static void main(String[] args) {

  	test01(2,3);
  }
  /** 思路一: &^ */
  @Test
  public static int test01(int a, int b) {
  	System.out.println("\n=============test01==============");
  	System.out.println("思路一: &^");
  	long time01 = System.currentTimeMillis();
  	
  	int result =0;

  	while(b!=0){
  		a=a&b;
  		b=a^b;
  	}
	  result=a;


  	int c=a&b;
    System.out.println("c = " +c);
    int d=a^b;
    System.out.println("d = " + d);

  	long time0101  = System.currentTimeMillis() - time01;
  	System.out.println("test01 耗时 =  " + time0101  + "ms");
  	System.out.println("=================================");
  
  	return result;
  }
}
